/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import entity.Actual_User;

/**
 *
 * @author David
 */
public class Menu extends javax.swing.JPanel {

    /**
     * Creates new form Menu
     */
    
    private Principal principal = Actual_User.getInstance().getPrincipal();
    
    public Menu() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton3 = new javax.swing.JButton();
        jToolBar1 = new javax.swing.JToolBar();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        logoutB = new javax.swing.JButton();
        debitarB = new javax.swing.JButton();
        acreditarB = new javax.swing.JButton();
        saldoB = new javax.swing.JButton();

        jButton3.setText("Sali");

        jToolBar1.setBackground(new java.awt.Color(0, 0, 0));
        jToolBar1.setRollover(true);

        jButton1.setText("Debitar");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton1);

        jButton2.setText("Acreditar");
        jButton2.setFocusable(false);
        jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton2);

        setBackground(new java.awt.Color(0, 0, 0));

        logoutB.setText("Salir");
        logoutB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutBActionPerformed(evt);
            }
        });

        debitarB.setText("Debitar");
        debitarB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                debitarBActionPerformed(evt);
            }
        });

        acreditarB.setText("Acreditar");
        acreditarB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                acreditarBActionPerformed(evt);
            }
        });

        saldoB.setText("Saldo");
        saldoB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saldoBActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(debitarB)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(acreditarB)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(saldoB)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                .addComponent(logoutB))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(layout.createSequentialGroup()
                .addGap(2, 2, 2)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(logoutB)
                    .addComponent(debitarB)
                    .addComponent(acreditarB)
                    .addComponent(saldoB)))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void debitarBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_debitarBActionPerformed
        // TODO add your handling code here:
        principal.debitar();
    }//GEN-LAST:event_debitarBActionPerformed

    private void acreditarBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acreditarBActionPerformed
        // TODO add your handling code here:
        principal.acreditar();
    }//GEN-LAST:event_acreditarBActionPerformed

    private void logoutBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutBActionPerformed
        // TODO add your handling code here:
        principal.logout();
    }//GEN-LAST:event_logoutBActionPerformed

    private void saldoBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saldoBActionPerformed
        // TODO add your handling code here:
        principal.saldo();
    }//GEN-LAST:event_saldoBActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton acreditarB;
    private javax.swing.JButton debitarB;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JButton logoutB;
    private javax.swing.JButton saldoB;
    // End of variables declaration//GEN-END:variables
}
